package br.cns;

import static org.junit.Assert.*;

import org.junit.Test;

import br.cns.transformations.FloydWarshallShortestPath;

public class ShortestPathFloydWarshall {

	@Test
	public void test() {
		FloydWarshallShortestPath a = FloydWarshallShortestPath.getInstance();
		Integer[][] m = new Integer[][] { { 0, 1, 0, 1 }, { 1, 0, 1, 0 },
				{ 0, 1, 0, 0 }, { 1, 0, 0, 0 } };

		Integer[][] d = a.transform(m);
		
		Integer[][] shortestPath = new Integer[][]{{ 0, 1, 2, 1 }, { 1, 0, 1, 2 },
				{ 2, 1, 0, 3 }, { 1, 2, 3, 0 }};

		assertArrayEquals(d, shortestPath);
	}

}
